use std::env;
use std::error::Error;

use clap::Parser;
mod cli;
use cli::{
    cli::{Cli, Commands},
    cmds,
};

fn main() -> Result<(), Box<dyn Error>> {
    dotenv::dotenv()?;
    let project_path = env::var("CSV_UTIL_PROJECT_PATH")?;

    let args = Cli::parse();
    match args.command {
        Commands::GenConfig(ref args) => cmds::gen_config(args),
        Commands::Test => cmds::test(),
    };

    println!("Project path: {}", project_path);
    Ok(())
}
